
1、后端返回数据基本格式
{
  "code": "00000",
  "data": {
    "list": [],
    "total": 2
  },
  "msg": "一切ok"
}

2、code约定
例如 code 0 为服务端响应成功 其余code均为失败



3、菜单新增编辑数据结构
const menuObj = {
  "id": "1",
  "parentId": "0", // 父级菜单id
  "name": "系统管理", // 菜单名称
  "type": 2, // 菜单类型 1:目录 2:菜单 3:按钮 4外链
  "routeName": "", // 路由名称
  "routePath": "/system", // 路由路径
  "component": "Layout",  // 组件路径
  "perm": null, // 按钮 权限字符串
  "visible": 1, // 显示状态 1显示 0隐藏
  "sort": 1, // 排序
  "icon": "system", // 图标
  "redirect": "/system/user",
  "keepAlive": null, // 是否缓存页面
  "alwaysShow": null, // 是否始终显示
  "params": null // 路由参数
}

4、菜单列表查询数据结构
const menuList = [
  {
    "id": "1",
    "parentId": "0",
    "name": "系统管理",
    "type": 2,
    "routeName": "",
    "routePath": "/system",
    "component": "Layout",
    "sort": 1,
    "visible": 1,
    "icon": "system",
    "redirect": "/system/user",
    "perm": null,
    "children": [
        {
            "id": "2",
            "parentId": "1",
            "name": "用户管理",
            "type": 1,
            "routeName": "User",
            "routePath": "user",
            "component": "system/user/index",
            "sort": 1,
            "visible": 1,
            "icon": "el-icon-User",
            "redirect": null,
            "perm": null,
            "children": [
                {
                    "id": "105",
                    "parentId": "2",
                    "name": "用户查询",
                    "type": 4,
                    "routeName": null,
                    "routePath": "",
                    "component": null,
                    "sort": 0,
                    "visible": 1,
                    "icon": "",
                    "redirect": null,
                    "perm": "sys:user:query",
                    "children": []
                },
            ]
        },
    ]
}
]

5、部门新增编辑数据结构
const deptObj = {
  "status": 1, // 状态 1正常 0禁用
  "parentId": "0", // 上级部门id
  "sort": 1, // 排序
  "id": "1",
  "name": "xx技术", // 部门名称·
  "code": "YOULAI" // 部门编码
}

6、部门列表查询数据结构
const deptData = [
  {
    "id": "1",
    "parentId": "0",
    "name": "xx技术",
    "code": "YOULAI",
    "sort": 1,
    "status": 1,
    "children": [
      {
        "id": "2",
        "parentId": "1",
        "name": "研发部门",
        "code": "RD001",
        "sort": 1,
        "status": 1,
        "children": [],
        "createTime": null,
        "updateTime": "2022-04-19 12:46"
      },
    ],
    "createTime": null,
    "updateTime": "2024-06-24 23:48"
  }
]


7、用户新增编辑数据结构
const userObj = {
  "status": 1, // 状态 1正常 0禁用
  "deptId": "1", // 所属部门id
  "username": "admin", // 用户名
  "nickname": "系统管理员", // 用户昵称
  "gender": 1, // 性别
  "roleIds": [ // 角色数组
    "2"
  ],
  "mobile": "18812345678", // 手机号码
  "email": "", // 邮箱
  "id": "2",
}

8、用户列表查询数据结构
const userData = {
  "list": [
    {
      "id": "3",
      "username": "test",
      "nickname": "测试小用户",
      "mobile": "18812345679",
      "gender": 1,
      "email": "youlaitech@163.com",
      "status": 1,
      "deptName": "测试部门",
      "roleNames": "访问游客",
      "createTime": "2021/06/05 01:31"
    }
  ],
  "total": 2
}


5、角色新增编辑数据结构
const roleObj = {
  "sort": 2, // 排序
  "status": 1, // 状态 1正常 0禁用
  "dataScope": 1,   // 数据权限 1全部数据权限 2部门及子部门数据权限 3本部门数据权限 4本人数据
  "id": "2",
  "name": "系统管理员", // 角色名称
  "code": "ADMIN", // 角色编码
  "dataScope": 1
}
6、角色列表查询数据结构
const roleList = {
  "list": [
    {
      "id": "2",
      "name": "系统管理员",
      "code": "ADMIN",
      "status": 1,
      "sort": 2,
      "createTime": "2021-03-25 12:39:54",
      "updateTime": null
    },
    {
      "id": "3",
      "name": "访问游客",
      "code": "GUEST",
      "status": 1,
      "sort": 3,
      "createTime": "2021-05-26 15:49:05",
      "updateTime": "2019-05-05 16:00:00"
    },
  ],
  "total": 11
}
7、角色权限分配数据结构
const rolePermList = [
  "1",
  "2",
  "105",
]
// 每一个字符代表 每一个菜单或者按钮对应的唯一value值

8、登录接口数据结构
const loginObj = {
  "tokenType": "Bearer",
  "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImRlcHRJZCI6MSwiZGF0YVNjb3BlIjoxLCJ0b2tlblR5cGUiOmZhbHNlLCJleHAiOjE3NTY3NDA1OTQsInVzZXJJZCI6MiwiaWF0IjoxNzU2NzMzMzk0LCJhdXRob3JpdGllcyI6WyJST0xFX0FETUlOIl0sImp0aSI6ImI3ZWY4NzIwZjVhYzQ5ODU5MWYyMzU1YWQ4M2VhNGFjIn0.uDsh5kOfx4HvyBbwjlSXFcDvJZmwKT-yzGrxwM6joc0",
  "refreshToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImRlcHRJZCI6MSwiZGF0YVNjb3BlIjoxLCJ0b2tlblR5cGUiOnRydWUsImV4cCI6MTc1NzMzODE5NCwidXNlcklkIjoyLCJpYXQiOjE3NTY3MzMzOTQsImF1dGhvcml0aWVzIjpbIlJPTEVfQURNSU4iXSwianRpIjoiZTE1YTI0M2U4ZTY5NDVmM2JkYmYxYjUwMDM0NDgwODQifQ.ExskUfetggCSSpxNSGc6hyjXBBIm2StvE-Je4WMEI1M",
  "expiresIn": 7200
}

9、用户信息数据结构
{
  "userId": "2",
  "username": "admin",
  "nickname": "系统管理员",
  "avatar": "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
  "roles": [
    "ADMIN"
  ],
  "perms": []
}
10、退出登录数据结构
const logOutObj = {
  "code": 0,
  "data": true,
  "msg": "一切ok"
}

11、   
分页约定字段
pageNum: 1,
pageSize: 10,